﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Hxsoft.AppV1.Module;

namespace Hxsoft.AppV1.Admin.LinkManage.Controls
{
	public partial class ModifyNavigation : BaseUserControl
	{
		#region property
		/// <summary>
		/// 当前的导航项键值。
		/// </summary>
		public string CurrentKey
		{
			get { return NavigationBar.CurrentKey; }
			set { NavigationBar.CurrentKey = value; }
		}

		/// <summary>
		/// 链接标识。
		/// </summary>
		public int LinkID
		{
			get
			{
				object oLinkID = ViewState["LinkID"];
				return oLinkID == null ? default(int) : (int)oLinkID;
			}
			set { ViewState["LinkID"] = value; }
		}
		#endregion

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
			{
				BindNavigationData();
				this.DataBind();
			}
		}

		protected void BindNavigationData()
		{
			string queryString = "?LinkID=" + LinkID + "&SiteId=" + SiteId;

			NavigationBar.NavigationItems.Add("ModifyLink", new OperationNavigationItem("信息修改", "~/LinkManage/ModifyLink.aspx" + queryString));
			NavigationBar.NavigationItems.Add("SettingLink", new OperationNavigationItem("信息设置", "~/LinkManage/LinkSetting.aspx" + queryString));
		}
	}
}